import { Pipe, PipeTransform } from '@angular/core';
// 自定义管道：exponentialStrength
@Pipe({
  name: 'exponentialStrength'
})
export class ExponentialStrengthPipe implements PipeTransform {

  // transform(value: any, ...args: any[]): any {
  //   return null;
  // }

  transform(value: number, exponent?: number): number {
    console.log(value, exponent);
    return Math.pow(value, isNaN(exponent) ? 1 : exponent);
  }

}
